package main

import (
	"github.com/gin-gonic/gin"
	"pipline_build_tag/conf"
	"pipline_build_tag/controllers"
	"pipline_build_tag/model"
	"pipline_build_tag/utils"
)

var logw = utils.WriteLog()

func main() {
	conf.DBinit()
	model.Init()
	route := gin.Default()
	route.POST("/api/v1/addtag", controllers.AddTag)      //添加 build tag
	route.POST("/api/v1/tagdate", controllers.GetTagDate) //过去 build tag的时间
	route.POST("/api/v1/gettag", controllers.GetTag)      //根据时间等参数 获取对应的tag
	err := route.Run(conf.Server.Listen.Host + ":" + conf.Server.Listen.Port)
	if err != nil {
		logw.Panic("无法监听再端口", conf.Server.Listen.Host+":"+conf.Server.Listen.Port)
		return
	}
}
